function Workspace(){
		
	this.addElement = function(obj){
	
		switch(obj.getElementType()){
			case "Button":
				$("#droppable").append('<div id="' + obj.getParentID() + '" class="' + obj.getParentClass() +'" style="position:absolute;width:auto;height:auto;border:1px dashed #ccc" ondblclick="getPropertyDetails(this)"><img id="del_' + obj.getID() +'" src="/images/delete.gif" style="top:0px;vertical-align:top;cursor:pointer">&nbsp;<a id="' + obj.getID() + '" href="#" class="' + obj.getClass() +'">' + obj.getID() + '</a></div>');
				break;
			case "Label":
				$("#droppable").append('<div id="' + obj.getParentID() + '" class="' + obj.getParentClass() +'" style="position:absolute;width:auto;height:auto;border:1px dashed #ccc" ondblclick="getPropertyDetails(this)"><img id="del_' + obj.getID() +'" src="/images/delete.gif" style="top:0px;vertical-align:top;cursor:pointer">&nbsp;<label id="' + obj.getID() +'">' + obj.getID() + '</label></div>');
				break;
			case "TextField":
				$("#droppable").append('<div id="' + obj.getParentID() + '" class="' + obj.getParentClass() +'" style="position:absolute;width:auto;height:auto;border:1px dashed #ccc" ondblclick="getPropertyDetails(this)"><img id="del_' + obj.getID() +'" src="/images/delete.gif" style="top:0px;vertical-align:top;cursor:pointer">&nbsp;<input type="text" name="' + obj.getID() +'" id="' + obj.getID() +'" value="' + obj.getID() +'" readonly="readOnly" /></div>');
				break;
			case "TextArea":
				$("#droppable").append('<div id="' + obj.getParentID() + '" class="' + obj.getParentClass() +'" style="position:absolute;width:auto;height:auto;border:1px dashed #ccc" ondblclick="getPropertyDetails(this)"><img id="del_' + obj.getID() +'" src="/images/delete.gif" style="top:0px;vertical-align:top;cursor:pointer">&nbsp;<textarea  name="' + obj.getID() +'" id="' + obj.getID() +'" style="resize:none" readonly="readOnly">' + obj.getID() +'</textarea></div>');
				break;
			case "Combobox":
				$("#droppable").append('<div id="' + obj.getParentID() + '" class="' + obj.getParentClass() +'" style="position:absolute;width:auto;height:auto;border:1px dashed #ccc" ondblclick="getPropertyDetails(this)"><img id="del_' + obj.getID() +'" src="/images/delete.gif" style="top:0px;vertical-align:top;cursor:pointer">&nbsp;<select  name="' + obj.getID() +'" id="' + obj.getID() +'"><option value="' + obj.getID() +'">' + obj.getID() +'</option></select></div>');
				break;
			case "Checkbox":
				$("#droppable").append('<div id="' + obj.getParentID() + '" class="' + obj.getParentClass() +'" style="position:absolute;width:auto;height:auto;border:1px dashed #ccc" ondblclick="getPropertyDetails(this)"><img id="del_' + obj.getID() +'" src="/images/delete.gif" style="top:0px;vertical-align:top;cursor:pointer">&nbsp;<input type="checkbox" name="' + obj.getID() +'" id="' + obj.getID() +'" value="' + obj.getID() +'"/>' + obj.getID() +'</div>');
				break;
			case "RadioButton":
				$("#droppable").append('<div id="' + obj.getParentID() + '" class="' + obj.getParentClass() +'" style="position:absolute;width:auto;height:auto;border:1px dashed #ccc" ondblclick="getPropertyDetails(this)"><img id="del_' + obj.getID() +'" src="/images/delete.gif" style="top:0px;vertical-align:top;cursor:pointer">&nbsp;<input type="radio" name="' + obj.getID() +'" id="' + obj.getID() +'" value="' + obj.getID() +'"/>' + obj.getID() +'</div>');
				break;
		}
		
		$(".draggable" ).draggable({
			revert: "invalid",
			scope: "items",
		containment: "#droppable"
		});
		
		$("#del_" + obj.getID()).click(function(){
			var ans = confirm("Are you sure you want to delete this object?");
			if(ans==true){
				$(this).parent().remove();
			}
		});	
			
		
		$('#' + obj.getParentID()).focus(function (e){
			$(this).css('background','#eee');
		});
		
		$('#'+ obj.getParentID()).blur(function (e){
			$(this).css('background','none');
		});		
	
	}
		
}